﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="DwCount.aspx.cs" Inherits="DwCount" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v10.2.Export, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="dx" %>

<%@ Register Assembly="DevExpress.XtraCharts.v10.2.Web, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.XtraCharts.Web" TagPrefix="dxchartsui" %>
<%@ Register Assembly="DevExpress.XtraReports.v10.2.Web, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.XtraReports.Web" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.XtraCharts.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.XtraCharts" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
    <script type="text/javascript">
        window.onload = function () {
            GridViewColor("<%=gvShow.ClientID%>", "#fff", "#eee", "#6df", "#fd6");
        }

        function GridViewColor(GridViewId, NormalColor, AlterColor, HoverColor, SelectColor) {

            var AllRows = document.getElementById(GridViewId).getElementsByTagName("tr");

            for (var i = 1; i < AllRows.length; i++) {

                AllRows[i].style.background = i % 2 == 0 ? NormalColor : AlterColor;


                if (HoverColor != "") {
                    AllRows[i].onmouseover = function () { if (!this.selected) this.style.background = HoverColor; }
                    if (i % 2 == 0) {
                        AllRows[i].onmouseout = function () { if (!this.selected) this.style.background = NormalColor; }
                    }
                    else {
                        AllRows[i].onmouseout = function () { if (!this.selected) this.style.background = AlterColor; }
                    }
                }


                if (SelectColor != "") {
                    AllRows[i].onclick = function () {
                        this.style.background = this.style.background == SelectColor ? HoverColor : SelectColor;
                        this.selected = !this.selected;
                    }
                }
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="MainContent">
    <h1 class="DemoTitle">
        各城区单位性质统计报表
    </h1>
    <div id="DemoArea" style="margin-left: 40px">
        <table>
            <tr>
                <td>
                    城区名称：
                </td>
                <td>
                    <dx:ASPxComboBox ID="cmbsscq" runat="server" ClientIDMode="AutoID" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                        CssPostfix="Office2010Blue" Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                        ValueType="System.String" DataSourceID="cmdShow" TextField="cqmc" ValueField="cqbh">
                        <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                        </LoadingPanelImage>
                        <LoadingPanelStyle ImageSpacing="5px">
                        </LoadingPanelStyle>
                    </dx:ASPxComboBox>
                </td>
                <td>
                    <dx:ASPxButton ID="btnSearch" runat="server" Text="查询" ClientIDMode="AutoID" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                        CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                        OnClick="btnSearch_Click">
                    </dx:ASPxButton>
                </td>
                <td>
                    <dx:ASPxButton ID="btnClear" runat="server" Text="清除过滤" ClientIDMode="AutoID" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                        CssPostfix="Office2010Blue" OnClick="btnClear_Click" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                    </dx:ASPxButton>
                </td>
                <td>
                    <dx:ASPxButton ID="btnExcel" runat="server" Text="导出到excel" 
                        ClientIDMode="AutoID" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                        CssPostfix="Office2010Blue" onclick="btnExcel_Click" 
                        SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" 
                        style="height: 24px">
                    </dx:ASPxButton>
                </td>
            </tr>
        </table>
        <asp:SqlDataSource ID="cmdShow" runat="server" ConnectionString="<%$ ConnectionStrings:CMSConnectionStrings %>"
            SelectCommand="SELECT * FROM [css_cqxx]"></asp:SqlDataSource>
        <asp:GridView ID="gvShow" runat="server" Width="800px" AutoGenerateColumns="False"
            OnRowCreated="gvShow_RowCreated" OnRowDataBound="gvShow_RowDataBound" Style="margin-right: 0px"
            PageSize="5" SelectedIndex="0">
            <Columns>
                <asp:BoundField HeaderText="编号" HeaderStyle-Width="40px" ItemStyle-Width="40px">
                    <HeaderStyle Width="40px"></HeaderStyle>
                    <ItemStyle Width="40px"></ItemStyle>
                </asp:BoundField>
                <asp:BoundField DataField="cqmc" HeaderText="城区" />
                <asp:BoundField DataField="qyl" HeaderText="企业类" HeaderStyle-HorizontalAlign="Center">
                    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                </asp:BoundField>
                <asp:BoundField DataField="stmfl" HeaderText="社团民非类" HeaderStyle-HorizontalAlign="Center">
                    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                </asp:BoundField>
                <asp:BoundField DataField="gyl" HeaderText="公益类" HeaderStyle-HorizontalAlign="Center">
                    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                </asp:BoundField>
                <asp:BoundField DataField="sqzzl" HeaderText="社区组织类" HeaderStyle-HorizontalAlign="Center">
                    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                </asp:BoundField>
            </Columns>
            <RowStyle HorizontalAlign="Center" />
            <PagerStyle HorizontalAlign="Center" />
            <HeaderStyle BackColor="Azure" Font-Bold="True" ForeColor="Black" CssClass="Freezing"
                Font-Size="12px" HorizontalAlign="Center" />
        </asp:GridView>
        <table>
            <tr>
                <td>
                    选择查看方式：
                </td>
                <td>
                    <dx:ASPxComboBox ID="cmbSelect" ClientInstanceName="cmbSelect" runat="server" ClientIDMode="AutoID"
                        CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
                        Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" ValueType="System.String">
                        <ClientSideEvents SelectedIndexChanged="function(s,e){chart.PerformCallback()}" />
                        <Items>
                            <dx:ListEditItem Text="饼状图" Value="B" />
                            <dx:ListEditItem Text="柱状图" Value="Z" />
                        </Items>
                        <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                        </LoadingPanelImage>
                        <LoadingPanelStyle ImageSpacing="5px">
                        </LoadingPanelStyle>
                        <ButtonStyle Width="13px">
                        </ButtonStyle>
                    </dx:ASPxComboBox>
                </td>
            </tr>
        </table>
        <dxchartsui:WebChartControl ID="WebChartControl" ClientInstanceName="chart" runat="server"
            Width="800px" Height="300px" IndicatorsPaletteName="Default" OnCustomCallback="WebChartControl_CustomCallback">
        </dxchartsui:WebChartControl>
        <dx:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" 
            GridViewID="gvShow">
        </dx:ASPxGridViewExporter>

    </div>
</asp:Content>
